#include <iostream>
#include "DrvControl.h"

using namespace std;

int InitiSys(boolean open)
{
	if (open)
	{
		if (!OpenDrv("DriverDemo"))
		{
			return -1;
		}
	}
	else
	{
		if (!LoadDrv("584ss", "DriverDemo2.sys", "DriverDemo"))
		{
			return -2;
		}
	}
	return 0;
}

int ReleaseSys(boolean open)
{
	if (open)
	{
		if (!CloseDrv())
		{
			return -1;
		}
	}
	else
	{
		if (!UnLoadDrv())
		{
			return -2;
		}
	}
	
	return 0;
}

int main()
{
	boolean open_drv = false;
	cout << "InitiSys:" << InitiSys(open_drv) << endl;
	getchar();

	DWORD x = 100, y = 0;
	ControlDrv(0x801, &x, sizeof(x), &y, sizeof(y));
	cout << y << endl;
	getchar();

	cout << "ReleaseSys:" << ReleaseSys(open_drv) << endl;
	getchar();

	return 0;
}